<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  </head>
  <body>
    <style>
      input:checked + span {
        color: red;
      }
    </style>
    <label for="stu">学生</label>
    <input type="radio" name="role" id="stu" />
    <span>abc</span>

    <input type="radio" name="role" />老师
  </body>
</html>
